﻿
CREATE PROCEDURE sp_User_GetByID 
	-- Add the parameters for the stored procedure here
	(
				@UserKey int,
				
				@Sys_IsDeleted int = 0,
				@Sys_OrganizationID int = -1
				
	)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT OFF;

	SELECT	[UserKey],
			[UserLoginID],
			[UserPassword],
			[UserFirstName],
			[UserLastName],
			[UserPrimaryEmailID],
			[UserVerificationCode],
			[UserIsVarified],
			[Sys_DateOfCreation],
			[Sys_DateOfModification],
			[Sys_CreatedByID],
			[Sys_ModifiedByID],
			[Sys_DeleteType],
			[Sys_IsDeleted],
			[Sys_OrganizationID],
			[Sys_InitialPrimaryKeys],
			[Sys_WorkstationName]
	FROM	[User]
	WHERE		
		(
			[UserKey] = @UserKey AND 
			[Sys_IsDeleted] = @Sys_IsDeleted AND
			[Sys_OrganizationID] = @Sys_OrganizationID
		);
END
